/* TODO:
    - dialog on creating new database
    - save URL, username and optinal password to server in DB
*/

#ifndef _DBASE_H
#define _DBASE_H

#include <vector>
class Note;
class NoteFilter;
class Keyword;
class KeywordFilter;
class wxString;

class DBase
{
public:
    virtual ~DBase() {}
    virtual bool Connect(const wxString& name) = 0;
    virtual void Disconnect() = 0;

    virtual bool ValidNoteID(int id) = 0;
    virtual bool WriteNewNote(Note &n) = 0;
    virtual bool OverwriteNote(const Note& n) = 0;
    virtual bool DeleteNote(int id) = 0;
    virtual bool SelectByFilter(std::vector<Note> *notes, const NoteFilter& filter) = 0;
    virtual bool GetNoteCount(int *cnt) = 0;

    virtual bool ValidKeywordID(int id) = 0;
    virtual bool WriteNewKeyword(Keyword& t) = 0;
    virtual bool OverwriteKeyword(const Keyword& n) = 0;
    virtual bool DeleteKeyword(int id) = 0;
    virtual bool ReadKeywords(std::vector<Keyword> *keywords, const KeywordFilter& filter) = 0;

    virtual bool isConnected() const = 0;
    virtual bool isModified() const  = 0;
    virtual void setModified(bool value) = 0;
};

#define NOTES_NO_LIMIT 0xFFFFFFFF

#endif
